package org.luxor.commons.selenium.component.storage;

import org.openqa.selenium.html5.LocalStorage;

import java.util.HashMap;
import java.util.Set;

/**
 * @author Mr.yan  @date 2022/6/2
 */
public class NoneLocalStorage implements LocalStorage {

    private final HashMap<String, String> storage = new HashMap<>();

    @Override
    public String getItem(String key) {
        return storage.get(key);
    }

    @Override
    public Set<String> keySet() {
        return storage.keySet();
    }

    @Override
    public void setItem(String key, String value) {
        storage.put(key, value);
    }

    @Override
    public String removeItem(String key) {
        return storage.remove(key);
    }

    @Override
    public void clear() {
        storage.clear();
    }

    @Override
    public int size() {
        return storage.size();
    }
}
